@dataknut)Please note that authorship is alphabetical. Contributions are listed below - see github for details and who to blame for what :-).
@dataknut)If you wish to refer to any of the material from this report please cite as:
Report circulation:
Report purpose:
This work is (c) 2019 the University of Southampton.
# done in makefile
Data downloaded from http://southampton.my-air.uk. See also https://www.southampton.gov.uk/environmental-issues/pollution/air-quality/.
Southampton City Council collects various forms of air quality data at the sites shown in 2.1. WHO publishes information on the health consequences and “acceptable” exposure levels for each of these.
lDT <- data.table::melt(dt, id.vars = c("site", "obsDateTime"), measure.vars = c("co",
"nox", "nox2", "noxes", "oz", "pm10", "pm2_5", "so2"), value.name = "value" # varies
)
# remove NA
lDT <- lDT[!is.na(value)]
t <- lDT[, .(from = min(obsDateTime), to = max(obsDateTime), nObs = .N), keyby = .(site,
variable)]
kableExtra::kable(t, caption = "Dates data available by site and measure", digits = 2) %>%
kable_styling()
| site | variable | from | to | nObs |
|---|---|---|---|---|
| Southampton - A33 Roadside AURN | nox | 2016-01-26 11:00:00 | 2019-12-04 22:00:00 | 33046 |
| Southampton - A33 Roadside AURN | nox2 | 2016-01-26 11:00:00 | 2019-12-04 22:00:00 | 33034 |
| Southampton - A33 Roadside AURN | pm10 | 2016-01-04 13:00:00 | 2019-12-04 21:00:00 | 31985 |
| Southampton - Onslow Road | nox | 2016-01-01 00:00:00 | 2019-12-08 18:00:00 | 33223 |
| Southampton - Onslow Road | nox2 | 2016-01-01 00:00:00 | 2019-12-08 18:00:00 | 33219 |
| Southampton - Onslow Road | noxes | 2016-01-01 00:00:00 | 2019-12-08 18:00:00 | 33223 |
| Southampton - Victoria Road | nox | 2016-01-01 00:00:00 | 2019-06-21 08:00:00 | 25024 |
| Southampton - Victoria Road | nox2 | 2016-01-01 00:00:00 | 2019-06-21 08:00:00 | 25024 |
| Southampton - Victoria Road | noxes | 2016-01-01 00:00:00 | 2019-06-21 08:00:00 | 25024 |
| Southampton Background AURN | nox | 2016-01-01 00:00:00 | 2019-12-04 22:00:00 | 27948 |
| Southampton Background AURN | nox2 | 2016-01-01 00:00:00 | 2019-12-04 22:00:00 | 27961 |
| Southampton Background AURN | noxes | 2016-01-01 00:00:00 | 2019-01-01 00:00:00 | 20026 |
| Southampton Background AURN | oz | 2016-01-01 00:00:00 | 2019-12-04 22:00:00 | 27847 |
| Southampton Background AURN | pm10 | 2016-01-01 00:00:00 | 2019-12-04 22:00:00 | 24397 |
| Southampton Background AURN | pm2_5 | 2016-01-01 00:00:00 | 2019-12-04 22:00:00 | 26605 |
| Southampton Background AURN | so2 | 2016-01-01 00:00:00 | 2019-12-04 22:00:00 | 27399 |
Summarise previously downloaded and processed data…
skimr::skim(dt)
## Skim summary statistics
## n obs: 209832
## n variables: 10
##
## ── Variable type:character ──────────────────────────────────────────────────────────────────────────────────────────────────────────
## variable missing complete n min max empty n_unique
## site 0 209832 209832 22 31 0 6
##
## ── Variable type:logical ────────────────────────────────────────────────────────────────────────────────────────────────────────────
## variable missing complete n mean count
## co 209832 0 209832 NaN 209832
##
## ── Variable type:numeric ────────────────────────────────────────────────────────────────────────────────────────────────────────────
## variable missing complete n mean sd p0 p25 p50 p75 p100
## nox 90591 119241 209832 26.6 40.24 -5 4.7 13.3 32.1 746.3
## nox2 90594 119238 209832 36.98 22.53 -1.3 20.5 33 48.8 287.5
## noxes 131559 78273 209832 76.53 74.84 -1.4 32.8 56.9 94 1431.8
## oz 181985 27847 209832 40.5 23.12 -0.2 23.9 41.2 56 174.1
## pm10 153450 56382 209832 18.71 13.18 -3.5 10.9 15.8 23.1 761.6
## pm2_5 183227 26605 209832 12.15 9.58 -4 6.6 9.5 14.4 289.2
## so2 182433 27399 209832 3.01 3.36 -1.1 0.9 1.7 3.7 50.5
## hist
## ▇▁▁▁▁▁▁▁
## ▇▆▁▁▁▁▁▁
## ▇▁▁▁▁▁▁▁
## ▆▇▇▂▁▁▁▁
## ▇▁▁▁▁▁▁▁
## ▇▁▁▁▁▁▁▁
## ▇▁▁▁▁▁▁▁
##
## ── Variable type:POSIXct ────────────────────────────────────────────────────────────────────────────────────────────────────────────
## variable missing complete n min max median
## obsDateTime 0 209832 209832 2016-01-01 2019-12-31 2017-12-30
## n_unique
## 34972
t <- dt[, .(`co: Carbon Monoxide, mg/m3` = mean(co, na.rm = TRUE), `nox = Nitric Oxide, ug/m3` = mean(nox,
na.rm = TRUE), `nox2 = Nitrogen Dioxide, ug/m3` = mean(nox2, na.rm = TRUE),
`noxes = Oxides of Nitrogen, ug/m3` = mean(noxes, na.rm = TRUE), `oz = ozone, ug/m3` = mean(oz,
na.rm = TRUE), `pm10, ug/m3` = mean(pm10, na.rm = TRUE), `pm2_5, ug/m3` = mean(pm2_5,
na.rm = TRUE), `so2 = Sulphur Dioxide, ug/m3` = mean(so2, na.rm = TRUE)),
keyby = .(site)]
kableExtra::kable(t, caption = "Mean values per site (NaN indicates not measured)") %>%
kable_styling()
| site | co: Carbon Monoxide, mg/m3 | nox = Nitric Oxide, ug/m3 | nox2 = Nitrogen Dioxide, ug/m3 | noxes = Oxides of Nitrogen, ug/m3 | oz = ozone, ug/m3 | pm10, ug/m3 | pm2_5, ug/m3 | so2 = Sulphur Dioxide, ug/m3 |
|---|---|---|---|---|---|---|---|---|
| Southampton - A33 Roadside AURN | NaN | 34.00597 | 35.79520 | NaN | NaN | 19.04556 | NaN | NaN |
| Southampton - Bitterne | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| Southampton - Onslow Road | NaN | 29.85249 | 42.17603 | 87.94943 | NaN | NaN | NaN | NaN |
| Southampton - Redbridge | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| Southampton - Victoria Road | NaN | 27.41410 | 39.92920 | 81.96427 | NaN | NaN | NaN | NaN |
| Southampton Background AURN | NaN | 13.24819 | 29.55140 | 50.78906 | 40.50492 | 18.27441 | 12.15377 | 3.014884 |
Table 3.1 gives an indication of the availability of the different measures.
In this section we present graphical analysis of the previoulsy downloaded data. Note this is just a snapshot of the data available.
yLab <- "Nitrogen Dioxide (ug/m3)"
t <- lDT[variable == "nox2", .(mean = mean(value, na.rm = TRUE), sd = sd(value,
na.rm = TRUE), min = min(value, na.rm = TRUE), max = max(value, na.rm = TRUE)),
keyby = .(site)]
kableExtra::kable(t, caption = "Summary of nox2 data") %>% kable_styling()
| site | mean | sd | min | max |
|---|---|---|---|---|
| Southampton - A33 Roadside AURN | 35.79520 | 25.00895 | 0.0 | 164.3 |
| Southampton - Onslow Road | 42.17603 | 21.07799 | 1.2 | 241.3 |
| Southampton - Victoria Road | 39.92920 | 23.97378 | -1.3 | 287.5 |
| Southampton Background AURN | 29.55140 | 16.94370 | 2.3 | 144.2 |
Table 4.1 suggests that there may be a few (5) negative values. These are summarised in 4.2 while Figure 4.1 shows the availability and levels of the pollutant data over time.
t <- head(dt[nox2 < 0], 10)
kableExtra::kable(t, caption = "Negative nox2 values (first 10)") %>% kable_styling()
| nox | nox2 | noxes | pm10 | site | co | oz | pm2_5 | so2 | obsDateTime |
|---|---|---|---|---|---|---|---|---|---|
| 0.4 | -0.1 | 0.6 | NA | Southampton - Victoria Road | NA | NA | NA | NA | 2016-01-29 04:00:00 |
| 0.8 | -0.5 | 0.7 | NA | Southampton - Victoria Road | NA | NA | NA | NA | 2016-11-27 05:00:00 |
| 0.9 | -1.1 | 0.3 | NA | Southampton - Victoria Road | NA | NA | NA | NA | 2016-11-27 06:00:00 |
| 1.5 | -0.2 | 2.1 | NA | Southampton - Victoria Road | NA | NA | NA | NA | 2017-02-06 00:00:00 |
| 1.1 | -1.3 | 0.3 | NA | Southampton - Victoria Road | NA | NA | NA | NA | 2017-02-06 01:00:00 |
t <- table(dt[nox < 0]$site)
kableExtra::kable(t, caption = "Negative nox2 values (count by site)") %>% kable_styling()
| Var1 | Freq |
|---|---|
| Southampton - Onslow Road | 248 |
| Southampton - Victoria Road | 166 |
# dt,xvar, yvar,fillVar, yLab
p <- makeTilePlot(lDT[variable == "nox2"], xVar = "obsDateTime", yVar = "site",
fillVar = "value", yLab = yLab)
p
Figure 4.1: Nitrogen Dioxide data availability and levels over time
# p <- ggplot2::ggplot(dt, aes(x = obsDateTime, y = nox2, colour = site,
# alpha = 0.1)) + geom_point(shape=4, size = 1)
t <- lDT[variable == "nox2" & value > 200][order(-value)]
kableExtra::kable(caption = paste0("Values greater than WHO threshold (NO2 > ",
hourlynox2Threshold_WHO, ")"), head(t, 10)) %>% kable_styling()
| site | obsDateTime | variable | value |
|---|---|---|---|
| Southampton - Victoria Road | 2016-11-30 17:00:00 | nox2 | 287.5 |
| Southampton - Victoria Road | 2016-11-30 19:00:00 | nox2 | 275.3 |
| Southampton - Victoria Road | 2016-11-30 18:00:00 | nox2 | 268.7 |
| Southampton - Victoria Road | 2017-01-05 18:00:00 | nox2 | 251.6 |
| Southampton - Victoria Road | 2017-01-05 17:00:00 | nox2 | 247.3 |
| Southampton - Victoria Road | 2017-01-24 18:00:00 | nox2 | 243.5 |
| Southampton - Victoria Road | 2017-01-24 19:00:00 | nox2 | 242.0 |
| Southampton - Onslow Road | 2016-03-08 09:00:00 | nox2 | 241.3 |
| Southampton - Victoria Road | 2017-01-03 08:00:00 | nox2 | 234.4 |
| Southampton - Victoria Road | 2017-01-03 09:00:00 | nox2 | 232.8 |
p <- makeDotPlot(lDT[variable == "nox2"], xVar = "obsDateTime", yVar = "value",
byVar = "site", yLab = yLab)
p <- p + geom_hline(yintercept = hourlynox2Threshold_WHO) + labs(caption = "Reference line = WHO hourly guideline threshold")
if (doPlotly) {
plotly::ggplotly(p) # interactive
} else {
p
}